/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Validations;

import Services.exception.ServiceException;
import Services.ProviderProductServices;
import beans.ProviderProductBean;

/**
 *
 * @author Anthar
 */
public class ProviderProductValidation {

    private ProviderProductServices providerProdService;

    public ProviderProductValidation(){
        providerProdService = new ProviderProductServices();

    }

      public boolean existProviderProduct(int idProduct, int idProvider) throws ServiceException{
         final ProviderProductBean providerProduct= getProviderProdService().searchProviderProduct(idProduct, idProvider);
        if(providerProduct!=null){
            return true;
        }
        return false;
    }

    /**
     * @return the providerProdService
     */
    public ProviderProductServices getProviderProdService() {
        return providerProdService;
    }

    /**
     * @param providerProdService the providerProdService to set
     */
    public void setProviderProdService(ProviderProductServices providerProdService) {
        this.providerProdService = providerProdService;
    }

   


}
